package com.example.pattern.singleton;

/**
 * 单例模式-"懒汉"模式
 */
public class Singleton2 {

    private Singleton2(){}

    private static Singleton2 instance;

    public static Singleton2 getInstance(){
        if(null != instance){
            instance = new Singleton2();
        }
        return instance;
    }

}
